<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/6/28
 * Time: 14:20
 */

namespace Publish\Lib;


class Upload
{
    /**
     * @param $Catalog 文件目录
     */
    public function FileUpload($Catalog)
    {
        /*上传文件*/
        $upload = new \Think\Upload();// 实例化上传类
        $upload->maxSize = 10 * 1024 * 1024;// 设置附件上传大小
        $upload->allowExts = array('mp3', 'mp4','wmv','avi','flv','mkv','mov','mpeg','f4v','m4v','rmvb','rm','3gp','dat','ts','mts','vob');// 设置附件上传类型
        $upload->rootPath = './' . C("UPLOADPATH"); // 设置附件上传根目录
        $upload->savePath = "./$Catalog/"; // 设置附件上传（子）目录

        // 上传文件
        $info = $upload->upload();
//        $data['frequency'] = $info['file_frequency']['savepath'] . $info['file_frequency']['savename'];
        return $info;
    }
}